<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="style.css">
    <!-- 

        总结：
            伸缩容器
                display:flex; flex-direction:row; flex-wrap:wrap;justify-content
                align-items align-content
            伸缩项目
                align-self
                order顺序 不加单位 值越小越靠前 默认是0 支持负值
     -->
     <style>
         .all{
             width: 100%; height:400px;
             background:#ccc; 
             display: flex;
            
     
         }
         .all div{
           width:50%;  
           height:130px;
           font-size: 40px;
  
         }
         .all>div:nth-child(1){
             background-color: red;
             order: -1;  
         }
         .all>div:nth-child(2){
             background-color: green;
             order: -4;
   
         }
         .all>div:nth-child(3){
             background-color: blue;
             order: -3;
           
         }
         .all>div:nth-child(4){
             background-color: yellow;
             order: -2;
           
         }
     </style>
</head>
<body>
    <div class="all">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
    </div>
</body>
</html>